From 33260663286776566647841d4e9cd109dc70f3bc Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 25 Jun 2011 16:41:29 +0000 Subject: [PATCH] Followup r89566 Per CR, add HTTP redirect from old feed listing on Special:Contributions to using the api module output --- includes/specials/SpecialContributions.php | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 0497f8f9b2..0c6560d21f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -115,6 +115,41 @@ class SpecialContributions extends SpecialPage { $this->opts['month'] = $wgRequest->getIntOrNull( 'month' ); } + $feedType = $wgRequest->getVal( 'feed' ); + if( $feedType ) { + $apiParams = array( + 'action' => 'feedcontributions', + 'feedformat' => $feedType, + 'user' => $target, + ); + if ( $this->opts['topOnly'] ) { + $apiParams['toponly'] = true; + } + if ( $this->opts['showSizeDiff'] ) { + $apiParams['showsizediff'] = true; + } + if ( $this->opts['deletedonly'] ) { + $apiParams['deletedonly'] = true; + } + if ( $this->opts['tagFilter'] !== '' ) { + $apiParams['tagfilter'] = $this->opts['tagFilter']; + } + if ( $this->opts['namespace'] !== '' ) { + $apiParams['namespace'] = $this->opts['namespace']; + } + if ( $this->opts['year'] !== null ) { + $apiParams['year'] = $this->opts['year']; + } + if ( $this->opts['month'] !== null ) { + $apiParams['month'] = $this->opts['month']; + } + + $url = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams ); + + $wgOut->redirect( $url, '301' ); + return; + } + // Add RSS/atom links $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $wgUser->getName() ) ); -- 2.20.1